\documentclass{article}
% translate with >> pdflatex -shell-escape <file>

% This file is used as unit test for pgfplots, copyright by Christian Feuersaenger.
% 
% See
%   http://pgfplots.sourceforge.net/pgfplots.pdf
% for pgfplots.
%
% Any required input files (for <plot table> or <plot file> or the table package) can be downloaded
% at
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/
% and
% http://www.ctan.org/tex-archive/graphics/pgf/contrib/pgfplots/doc/latex/plotdata/

\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\pagestyle{empty}

\begin{document}
		\pgfplotsset{stack plots=y}
		\def\smallplotstest{%
			\addplot coordinates {(0,1) (1,2) (2,2) (3,4)};
			\addplot coordinates {(0,1) (1,2) (2,2) (3,4)};
		}
		\def\loglogtestplot{%
			\addplot coordinates {(1e3,1e-4) (1e4,1e-5) (1e5,1e-5) (1e6,1e-6)};
			\addplot coordinates {(1e3,1e-4) (1e4,1e-5) (1e5,1e-5) (1e6,1e-6)};
		}%
		\pgfplotsset{cycle list={{blue},{red}}}
\begin{tikzpicture}
			\begin{axis}
				\smallplotstest
			\end{axis}
		\end{tikzpicture}
\end{document}
